package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 38917
 * Date: 2025-03-03
 * Time: 09:57
 */
class Singleton_Hungry {
    private static final Singleton_Hungry hungry = new Singleton_Hungry();

    public static Singleton_Hungry get(){
        return hungry;
    }
    
    private Singleton_Hungry(){}
}

public class demo1 {
    public static void main(String[] args) {
        Singleton_Hungry object1 = Singleton_Hungry.get();
        Singleton_Hungry object2 = Singleton_Hungry.get();
        System.out.println(object1);
        System.out.println(object2);
        System.out.println(object1 == object2);
    }
}
